<?php
	$currentFile = $_SERVER["PHP_SELF"];
	$parts = Explode('/', $currentFile);
	$filename = $parts[count($parts) - 1];
	
	if ($filename != "dkonten.php"){
		//nothing to do
	}else{
		echo "<div id='tag-box'>";
		echo "<div clas='tag-line'>Tag by : <span id='kettag'>$tags</span></div>";
		echo "<div clas='tag-line'>Sorted by : <span id='ketby'><select id='select-sort' onchange=\"getTagged('kettag','konten','select-sort','select-order')\">";
										echo "<option value='tgl'>Newest</option>";
										echo "<option value='jmlLike'>Most Popular</option>";
										echo "<option value='jmlKom'>Most Commented</option>";
									echo "</select></span></div>";
		echo "<div clas='tag-line'>Order by : <span id='ketorder'><select id='select-order' onchange=\"getTagged('kettag','konten','select-sort','select-order')\">";
										echo "<option value='DESC'>Descending</option>";
										echo "<option value='ASC'>Ascending</option>";
									echo "</select></span></div>";
		echo "<div class='tag-search'>";
			echo "<div>Tags :";
			echo "<div id='tag-input'><input type='text' id='tag-text' name='tag-text' /></div></div>";
			echo "<div id='tag-btn'><input type='button' id='tag-submit' name='tag-submit' value='Get Content!' onclick=\"getTags('tag-text','konten','select-sort','select-order')\"/></div>";
		echo "</div>";
		echo "<div class='tag-list'>";
			echo "<div>Tags :</div>";
			echo "<div>";
				$qres = mysql_query("SELECT * FROM tag");
				while($row = mysql_fetch_array($qres))
				{
					echo "<a href=\"javascript:getTag('".$row['nama']."','konten','select-sort','select-order')\">".$row['nama']."</a>, ";
				}
			echo "</div>";
		echo "</div>";
		echo "</div>";
	}
?>
<div class="iklan">
	<? if (!isset($_SESSION['username'])) { ?>
		<? if ($filename != "register.php") { ?>
			<div id="post-now"><a href="register.php">REGISTER NOW!</a></div>
		<? } ?>	
	<? } else { ?>
		<? if ($filename != "post.php")  { ?>
			<div id="post-now"><a href="post.php">POST NOW!</a></div>
		<? } ?>
	<? } ?>	
	<div id="adsay"><em>Advertisement</em></div>
	<a href="http://www.marlboro.com/"><img src="images/iklan-satu.jpg" alt="iklan 1" /></a>
</div>